package hu.stud.uszeged.inf.prf.prftrac.session.controllers;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.security.Credentials;

import hu.stud.uszeged.inf.prf.prftrac.session.UserHome;
import hu.stud.uszeged.inf.prf.prftrac.session.dao.UserDao;

@Name("templateController")
public class TemplateController {
	
	@In("#{userDao}")
	private UserDao userDao;
	@In("#{userHome}")
	private UserHome userHome;
	@In("#{credentials}")
	private Credentials creds;
	
	public String getProjectName() {
		userHome.setInstance(userDao.getUserByNickName(creds.getUsername()));
		return userHome.getInstance().getProject().getName();
	}
}
